<?php include Kohana::find_file('classes', 'util'); ?>
<!-- Seednia home -->
v1.2

<script type="text/javascript">
// FYI jQuery: multiple $(document).ready() is possible.
$(document).ready(function() {
	initHomeForm();
	$('#tagsCsv').tagsInput({
		'height':'40px',
		'width':'300px'});
});
</script>

<form id="FormPost" name="FormPost" method="post" action="<?php echo WEBCONTEXT; ?>/index.php/Post/add" >
<fieldset>
	<?php echo Form::select('categorySid', $ref_categories, null); ?><br />
	<textarea style="height:75px; width:300px" id="postBody" name="postBody"></textarea>
	<label class="error" for="postBody" id="postBody_error">This field is required.</label>
	<br />
	<input id="tagsCsv" name="tagsCsv" />
	<input type="submit" name="submit" class="button" id="btn_submit" value="Send" /> 
</fieldset>
</form>

<div id="post_stream">
	<form id="QueryPost" name="QueryPost" method="post" action="<?php echo WEBCONTEXT; ?>/index.php/Home" >
	<fieldset>
		<input id="tagsCsv" name="tagsCsv" />
		<input type="submit" name="submit" class="button" id="btn_search" value="Send" /> 
	</fieldset>
	</form>
<?php foreach ($posts as $post) {?>
	<p>
	<div>
	[<?php echo $post->{'@sid'} ?>] <?php echo $post->creatorDto->firstName; ?> 
	<?php echo datetime_parse_from_std($post->{'@createDt'})->format('y-m-d'). ' ('. time_ago($post->{'@createDt'}).' ago)'; ?>
	<?php echo $post->body; ?></div>
	<div ><?php echo $post->postTagNamesCsv; ?></div>

<?php } ?>
</div>